package cn.huoyingkeji.common.exception;

import cn.huoyingkeji.common.domain.IResultCode;
import lombok.Getter;

/**
 * 统一异常响应类
 */
@Getter
public class SharpknifeException extends RuntimeException{

    private int code;

    private String message;
    public SharpknifeException(int code,String message){
        this.code = code;
        this.message = message;
    }
    public static SharpknifeException build(IResultCode resultCode){
        return new SharpknifeException(resultCode.getCode(), resultCode.getMessage());
    }
}
